/*
 * Copyright (C) 2013 SeekDeepWithin.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package com.seekdeepwithin.Data;

import com.seekdeepwithin.DataAccess.*;

/**
 * User: Jonathan Montiverdi
 * Date: Sep 26, 2013
 *
 * Represents a style object.
 */
public class Style extends BaseDbObject
{
   private int m_StyleTypeId;
   private int m_Start;
   private int m_End;
   private int m_PassageStyleId;
   private final String m_StyleType;

   /**
    * Initializes a new style object.
    * @param id ID of style.
    * @param typeId ID of style type.
    * @param style Style.
    */
   public Style (int id, int typeId, String style)
   {
      super (id, style);
      this.m_StyleTypeId = typeId;
      this.m_StyleType = SdwDatabase.getInstance ().getStyleType (this.m_StyleTypeId);
   }

   /**
    * Gets the ID of the style type.
    * @return The styles type ID.
    */
   public int getTypeId ()
   {
      return this.m_StyleTypeId;
   }

   /**
    * Gets the style type.
    * @return The style type.
    */
   public String getStyleType ()
   {
      return this.m_StyleType;
   }

   /**
    * Gets the style.
    * @return The style
    */
   public String getStyle ()
   {
      return this.getName ();
   }

   /**
    * Gets the start index of the link.
    * @return The links start index.
    */
   public int getStartIndex ()
   {
      return this.m_Start;
   }

   /**
    * Sets the start index of the link.
    * @param startIndex The links start index.
    */
   public void setStartIndex (int startIndex)
   {
      this.m_Start = startIndex;
   }

   /**
    * Gets the end index of the link.
    * @return The links end index.
    */
   public int getEndIndex ()
   {
      return this.m_End;
   }

   /**
    * Sets the end index of the link.
    * @param endIndex The links end index.
    */
   public void setEndIndex (int endIndex)
   {
      this.m_End = endIndex;
   }

   /**
    * Gets the passage style ID.
    * @return ID of the passage style.
    */
   public int getPassageStyleId ()
   {
      return this.m_PassageStyleId;
   }

   /**
    * Sets the passage style ID.
    * @param passageStyleId Passage style ID.
    */
   public void setPassageStyleId (int passageStyleId)
   {
      this.m_PassageStyleId = passageStyleId;
   }
}
